
package org.springblade.common.enums.rate;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 固定资产类型
 * @author samwuu
 */
@Getter
@AllArgsConstructor
public enum GiftExchangeStatusEnum {

	NORMAL("无状态","无状态", 0),
	APPLY("申请中","申请中", 1),
	DEAL("成交","成交", 2),
	CANCEL("取消","取消", 3),
	;

	final String keyword;
	final String desc;
	final Integer key;

	public static GiftExchangeStatusEnum getEnum(String keyword) {
		if (keyword == null) {
			return null;
		} else {
			for (GiftExchangeStatusEnum s : GiftExchangeStatusEnum.values()) {
				if (s.getKeyword().equals(keyword)) {
					return s;
				}
			}
			return null;
		}
	}
	public static GiftExchangeStatusEnum getEnum(Integer key) {
		if (key == null) {
			return null;
		} else {
			for (GiftExchangeStatusEnum s : GiftExchangeStatusEnum.values()) {
				if (s.getKey().equals(key)) {
					return s;
				}
			}
			return null;
		}
	}

}
